const hcw = 'http://192.168.31.33:8101/'
const dfq = 'http://192.168.31.173:8101/'
const dev = 'http://dev.center.xiongmaodangao.com'
const test = 'http://test.center.xiongmaodangao.com'
const prod = 'http://center.xiongmaodangao.com'
const { proxy } = require('./environments/proxy.js')

module.exports = {
  lintOnSave: false,
  productionSourceMap: false,
  chainWebpack: (config) => {
    //忽略的打包文件
    config.externals({
      'vue': 'Vue',
      'vue-router': 'VueRouter',
      'vuex': 'Vuex',
      'axios': 'axios',
      'element-ui': 'ELEMENT',
      'AMap': 'AMap'
    })
    const entry = config.entry('app')
    // entry
    //   .add('babel-polyfill')
    //   .end()
    entry
      .add('classlist-polyfill')
      .end()
    entry
      .add('@/mock')
      .end()
  },
  configureWebpack: config => {
    // if (process.env.NODE_ENV === 'development') {
    //   config.devtool = 'eval-source-map'
    // } else {
    //   config.devtool = 'cheap-source-map'
    // }
      config.devtool = 'source-map'
  },
  devServer: {
    // 反向代理配置
    proxy,
    clientLogLevel: 'info',// 日志级别
    //   overlay: {
    //     warnings: false,
    //     errors: false
    // },
    //  lintOnSave: false,
    // 端口配置
    port: 1888,
  }
}
